<template>
	<view class="car-programme">
		<view class="title">租车方案</view>
		<Progranmme :list="schemes" :curren="curren" @change="currenChange" />
	</view>
</template>

<script setup>
	import {
		ref,
		defineProps,
		defineEmits,
		inject
	} from 'vue'
	import Progranmme from './Progranmme.vue'
	defineProps({
		schemes: {
			type: Array,
			default: () => []
		}
	})
	const curren = inject('curren')
	const currenChange = inject('currenChange')
</script>

<style lang="scss" scoped>
	.car-programme {
		margin-top: 28rpx;
		padding: 24rpx;
		box-sizing: border-box;
		border-radius: 16rpx;
		background: #FFFFFF;

		.title {
			font-size: 36rpx;
			font-family: PingFang SC-Bold, PingFang SC;
			font-weight: bold;
			color: #333333;
		}

		.programmes {
			.programme {
				margin-top: 24rpx;
				display: flex;
				align-items: center;
				border-radius: 16rpx;
				border: 2rpx solid #DDDDDD;
				padding: 30rpx 36rpx;
				position: relative;

				.month {
					width: 170rpx;
				}

				.prices {
					flex: 1;
				}

				.deposit {
					width: 140rpx;
				}

				.value {
					font-size: 24rpx;
					font-family: PingFang SC-Bold, PingFang SC;
					font-weight: bold;
					color: #333333;

					text {
						&:first-child {
							font-size: 36rpx;
						}
					}
				}

				.label {
					margin-top: 8rpx;
					font-size: 26rpx;
					font-family: PingFang SC-Regular, PingFang SC;
					font-weight: 400;
					color: #999999;
				}

				.active {
					position: absolute;
					right: 0;
					bottom: 0;
					width: 46rpx;
					height: 42rpx;
					background: #FF930D;
					border-radius: 20rpx 0rpx 14rpx 0rpx;
					display: flex;
					align-items: center;
					justify-content: center;
					color: #fff;
					font-weight: bold;
				}

				&-active {
					border-color: #FF930D;
					background: #FFFBF2;

					.value {
						color: #FE592D;
					}
				}
			}
		}
	}
</style>